<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<script src="/script/jquery-1.4.4.js"></script>
<html>
<title>SpringMvc学习</title>
<script type="text/javascript">
    $(function(){
        $("#listAllUser").click(function(){
            var url = this.href;
            var args = {};
            $.post(url, args, function(data){
                for(var i = 0; i < data.length; i++){
                    var userName = data[i].userName;
                    var userAge = data[i].userAge;

                    alert("userName = " + userName + ",userAge = " + userAge);
                }
            });
            return false;
        });
    })
</script>
<head>
</head>
<body>
<h4>Hello SpringMVC!</h4>
<form action="/user/testModelAttribute" method="post">
    <input type="hidden" name="id" value="1">
    用户名：<input type="text" name="userName" value="jack">
    <br>
    年龄：<input type="text" name="userAge" value="35">
    <br>
    地址：<input type="text" name="aderess.street" value="">
    <br>
    <input type="submit" value="提交">
</form>

<a href="/user/helloworld.html?userName=123&&userAge=19">测试params（url中含有符合条件的参数）</a>
<br>
<a href="/user/helloworld.html">测试params（url中无参数）</a>
<br>
<a href="/user/testPathVariable/123">测试PathVariable</a>
<br>
<a href="/user/regist.html">去注册</a>
<br>
<a href="/user/testRequestParam.html?userName=jackwei2008&&userAge=20">测试RequestParam</a>
<br>
<a href="/user/testRequestHeader.html">测试RequestHeader</a>
<br>
<a href="/user/testMatrixVariable/22;param=11.html">测试MatrixVariable</a>
<br>
<a href="/user/createUser.html?userName=123&&userAge=19&&aderess.street=府东公园6栋&&aderess.city=太原&&aderess.province=山西">
    测试使用 POJO 对象绑定请求参数值</a>
<br>
<a href="/user/testSpringMVCMap.html">测试返回Map</a>
<br>
<a href="/restUser/testRestController">测试使用RestController返回json</a>
<br>
<a href="/user/testSessionAttributes">测试使用sessionAttributes</a>
<br>
<a href="/user/testInternal.html">测试使用国际化</a>
<br>
<a href="/user/testRedirect.html">测试重定向</a>
<br>
<a href="/user/testCustmView">测试使用自定义视图</a>
<br>
<a href="/user/users">查询所有用户</a>
<br>
<a href="/user/listAllUser" id="listAllUser">json返回所有用户</a>
</body>
</html>
